#include <stdio.h>
#include <math.h>
int su(int n){
    if(n<2)return 0;
    int k=sqrt(n);
    for(int i=2;i<=k;i++)
        if(n%i==0)
            return 0;
    return 1;
}
int main(){
    int i, j, k, n, s = 0, r = 0, q = 0;
    int num[25] = {0}, arr[100], sum[60] = {1};
    scanf("%d", &n);
    for (i = 2; i <= n; i++){
        arr[i-2]=i;
        if(su(i))
            num[s++] = i;
    }for (i = 0; i < s; i++){
        for (j = 0; j < n - 1; j++)
            if (arr[j] % num[i] == 0){
                q = 0;
                for (k = 0; k <= r; k++){
                    sum[k] = sum[k] * num[i] + q;
                    q = sum[k] / 10;
                    sum[k] %= 10;
                }while(q>0){
                    sum[++r] = q%10;
                    q/=10;
                }while(j<n-1)
                    if(arr[j++]%num[i]==0)
                        arr[j-1] /= num[i];
                i--;
            }
    }
    for (i = r; i > -1; i--)
        printf("%d", sum[i]);
}